ear

# 定义变量
REPORT_FILE="report_24055060343.txt"

# 输出报告标题
echo "Storage Report by 何臣飞" | tee $REPORT_FILE

# 分隔线
echo "==========================================" | tee -a $REPORT_FILE

# 显示RAID 1阵列状态
echo -e "\n1. RAID 1阵列状态:" | tee -a $REPORT_FILE
echo "------------------------------------------" | tee -a $REPORT_FILE
sudo cat /proc/mdstat | tee -a $REPORT_FILE
echo | tee -a $REPORT_FILE
sudo mdadm --detail /dev/md1 2>/dev/null | tee -a $REPORT_FILE

# 显示LVM卷组状态
echo -e "\n2. LVM卷组状态:" | tee -a $REPORT_FILE
echo "------------------------------------------" | tee -a $REPORT_FILE
sudo vgs vg_0343 | tee -a $REPORT_FILE
echo | tee -a $REPORT_FILE
sudo vgdisplay vg_0343 | tee -a $REPORT_FILE

# 显示LVM逻辑卷状态 - 修复这里
echo -e "\n3. LVM逻辑卷状态:" | tee -a $REPORT_FILE
echo "------------------------------------------" | tee -a $REPORT_FILE
sudo lvs vg_0343/lv_hechenfei | tee -a $REPORT_FILE  # 修改这里
echo | tee -a $REPORT_FILE
sudo lvdisplay vg_0343/lv_hechenfei | tee -a $REPORT_FILE  # 修改这里

# 显示文件系统挂载情况
echo -e "\n4. 文件系统挂载情况:" | tee -a $REPORT_FILE
echo "------------------------------------------" | tee -a $REPORT_FILE
df -h | grep -E "(Filesystem|/mnt/secure_data)" | tee -a $REPORT_FILE

# 显示块设备信息
echo -e "\n5. 块设备详细信息:" | tee -a $REPORT_FILE
echo "------------------------------------------" | tee -a $REPORT_FILE
lsblk | tee -a $REPORT_FILE

echo -e "\n报告已保存到: $REPORT_FILE"
